// 封装攻略管理相关接口
import request from '@/utils/request'

// 攻略
// 获取攻略列表数据
export const getPostDataService = ({ pageSize, page, type }) => {
  return request({
    url: '/api/post/list',
    method: 'GET',
    params: {
      pageSize,
      page,
      type
    }
  })
}

// 攻略热门状态切换
export const ToggleHotPostService = (id) => {
  return request({
    url: `/api/post/hot/toggle/${id}`,
    method: 'PATCH'
  })
}

// 攻略列表搜索功能实现
export const searchPostService = (data) => {
  return request({
    url: '/api/post/search',
    method: 'GET',
    params: {
      data
    }
  })
}

// 删除攻略
export const deletePostService = (id) => {
  return request({
    url: `/api/post/del/${id}`,
    method: 'DELETE'
  })
}
